%This is a program that calculates max peak amplitude of behavioral
%response
filenames=dir('*MidBrains_procdata_ha.mat');

for i=1:length(Stim_type)
    if ~isnan(peak_amp{i})
        peak_amp_t(i)=max(abs(peak_amp{i}));
    else
        peak_amp_t(i)=0;
    end
end
figure;plot(peak_amp_t,'*')